#include "LuaLink_Gui.h"

LuaLink_Gui::LuaLink_Gui(MyGUI::Gui* gui) {
	mGui = gui;
	active = true;
}

LuaLink_Gui::~LuaLink_Gui(void) {
}

void LuaLink_Gui::lua_loadLayout(const char* layout) {
	MyGUI::LayoutManager::getInstancePtr()->load(layout);
}

bool LuaLink_Gui::isActive() {
	return active;
}

void LuaLink_Gui::lua_disable() {
	active = false;
}

void LuaLink_Gui::lua_enable() {
	active = true;
}

bool LuaLink_Gui::lua_isActive() {
	return active;
}

LuaLink_Widget* LuaLink_Gui::lua_findWidget(const char* name) {
	std::string str = name;
	return new LuaLink_Widget(mGui->findWidgetT(str, true));
}

